export default {
	namespaced:true,
	state: {
		orderList:[],
	},
	getters: {
		getOrderByid: (state)=> (id)=>{
			return state.orderList.find(item => item.id === id);
		},
		getOrderList: (state)=>{
			return state.orderList;
		}
	},
	mutations: {
		del(state){
			state.orderList = [];
		},
		add(state,obj){
			state.orderList.push(obj);
		},
	},
	actions: {
		addOrders(context,obj){
			context.commit('add',obj)
		},
		delOrders(context){
			context.commit('del')
		}
	}
}